package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "安德留斯")
@Order(1006)
@Component
public class AnDeLiuSi extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int dmg;
        String desc;
        int i = RandomUtil.randomInt(1);
        if (i == 0) {
            int orgAtk = first.getBattleInfo().getAtk();
            int def = second.getBattleInfo().getDef();
            int atk = (int) (orgAtk * 1.2);
            dmg = battleHelper.calAtk(atk, def);
            desc = RandomUtil.choice(Lists.newArrayList("北风突袭", "北风连爪","风狼甩尾"));
        } else {
            int orgAtk = first.getBattleInfo().getSpell();
            int def = second.getBattleInfo().getRes();
            int atk = (int) (orgAtk * 1.2);
            dmg = battleHelper.calSpell(atk, def);
            desc = RandomUtil.choice(Lists.newArrayList("北风之冻", "急冻冲击","狼灵幻影"));
        }
        battleHelper.autoAction(this, first, second, content, dmg, desc);
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的攻击手段");
    }

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "守望着奔狼领的「卢皮卡」，无比崇高的伟大灵魂。\n" +
                "当群狼受到威胁时，会以狼的姿态现世，展现自己的苍牙与利爪。\n" +
                "奔狼领的狼对蒙德人而言，通常是诡谲的魅影：\n" +
                "树木之间一闪而过的模糊形象、方位难辨的凄嚎，以及独行郊野林中时，时常能隐约感受到的视线。\n" +
                "人与狼冰冷的双眸直视的机会很少，因为「王狼」为自己的族类订立了规矩。\n\n" +
                "会随机使用物理与法术攻击 \n" +
                "物理 ：北风突袭,北风连爪,风狼甩尾\n" +
                "法术 ：北风之冻,急冻冲击,狼灵幻影\n\n" +
                "掉落物：\n" +
                "北风之尾,北风之环,北风的魂匣，奔狼庇护秘籍";
    }


}
